package com.xuan.task.Mapper;

import com.xuan.task.domain.WordPracticeFile;
import org.apache.ibatis.annotations.*;
import org.hibernate.validator.constraints.pl.REGON;

import java.util.List;


@Mapper
public interface WordPracticeFileMapper {

    @Select( " <script> select * from word_practice_file where user_id=#{userId} and word in" +
            " <foreach collection='wordList' open='(' item='word' separator=',' close=')'>#{word}</foreach>" +
            " </script>" )
   @Results(value = {
           @Result(property ="id",column = "id"),
           @Result(property ="userId",column = "user_id"),
           @Result(property ="word",column = "word"),
           @Result(property ="memoryWeight",column = "memory_weight"),
           @Result(property ="memoryWeightHistory",column = "memory_weight_history"),
           @Result(property ="initMemoryWeight",column = "init_memory_weight"),
           @Result(property ="memoryValueHistory",column = "memory_value_history"),
           @Result(property ="learnTheNumber",column = "learn_the_number"),
           @Result(property ="currentLearnTime",column = "current_learn_time"),
           @Result(property ="nextLearnTime",column = "next_learn_time"),
           @Result(property ="writeWeight",column = "write_weight"),
           @Result(property ="readWeight",column = "read_weight"),
           @Result(property ="pronunciationWeight",column = "pronunciation_weight"),
           @Result(property ="addWeightLastTime",column = "add_weight_last_time"),
           @Result(property ="createTime",column = "create_time"),
           @Result(property ="updateTime",column = "update_time"),
   })
    List<WordPracticeFile> getListByUserIdAndWordList(@Param( "userId" ) String userId, @Param( "wordList" ) List<String> wordList);

}
